package com.econ.powercloud.ems.common.enums;

/**
 * 并离网节点操作类型枚举
 * @author jwc
 * @date 2022/08/11
 */
public enum GridOperationTypeEnum implements EnumMethod{
    SEND_YK_YT(1,"下发遥控/遥调"),
    SEND_ORDER(2,"下发命令"),
    CHECK_DIT(3,"查询结果"),
    TRIGGER(4,"手动触发")
    ;
    private Integer code;
    private String desc;
    GridOperationTypeEnum(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    @Override
    public Integer getCode() {
        return code;
    }

    @Override
    public String getDesc() {
        return desc;
    }

    public static String fromCode(Integer code) {
        for (GridOperationTypeEnum obj : GridOperationTypeEnum.values()) {
            if (code.equals(obj.getCode())) {
                return obj.getDesc();
            }
        }
        return null;
    }

}
